﻿using Kendo.Mvc.Extensions;
using Kendo.Mvc.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CallCenter.Data;
using CallCenter.Data.BizUtilities;
using System.Configuration;
using System.Data;
using CallCenter.Security;
using CallCenter.Data.Models;
using CallCenter.Data.Misc;
namespace CallCenter.Web.Controllers
{
    public class UsersController : BaseController
    {
        // GET: Users
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult UsersHistory()
        {
            RegisterViewModel cmpy = new RegisterViewModel();
            return View(cmpy);
        }
        public JsonResult GetListOfUsers()
        {
                       
            var scratchPads = this.Bridge.AccountUtility.GetListOfActiveUsers();
            return Json(scratchPads, JsonRequestBehavior.AllowGet);
        }

        [HttpPost]
        public JsonResult DeleteUser(RegisterViewModel model)
        {
            //insert items into respective tables
            int id = model.Id;
            this.Bridge.AccountUtility.Deleteuser(id);
            var returnMessage = "Success";
            return Json(returnMessage, JsonRequestBehavior.AllowGet);

        }




    }
}